package com.hwpt.dto.user;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import static com.hwpt.constant.ExceptionMessageConstant.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class VerifyCodeDTO {

    @NotBlank(message = PHONE_EMPTY)
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = PHONE_FORMAT_ERROR)
    private String phone;

    @NotBlank(message = VERIFY_CODE_EMPTY)
    @Pattern(regexp = "^\\d{6}$", message = VERIFY_CODE_FORMAT_ERROR)
    private String verifyCode;
}
